{if !$embedded}<?xml version="1.0"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

{config_load file="catalog.conf"}
{config_load file=$module->getConfig()}

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{$language->getLanguage()}" dir="{$language->getDirection()}">
	<head>
		{include file=$theme->getTemplateUrl("head_common.tpl")}
		<title>{#PAGE_TITLE#}</title>
	</head>
	
	<body>
		{include file=$theme->getTemplateUrl("body_start.tpl")}
		
		<h2>{#HEADING_TITLE#}</h2>
		
		{if #TEXT_MAIN#}
			<p>{#TEXT_MAIN#}</p>
		{/if}
{/if}
		
		{assign var="split" value=$module->getProductsSplit($smarty.get.page)}
		
		{if $split->getTotalResults() > 0}
			<p>{$split->getFirstIndex()} {#TEXT_TO#} {$split->getLastIndex()} {#TEXT_OF#} {$split->getTotalResults()} {#TEXT_PRODUCTS#}</p>
			
			{if $smarty.const.PREV_NEXT_BAR_LOCATION == 1 || PREV_NEXT_BAR_LOCATION == 3}
				{include file="paginate_results.tpl" split=$split}
			{/if}
			
			<table>
				<thead>
					<tr>
						<th>{#TEXT_TABLE_HEADER_IMAGE#}</th>
						<th>{#TEXT_TABLE_HEADER_DETAILS#}</th>
						<th>{#TEXT_TABLE_HEADER_PRICE#}</th>
						<th>{#TEXT_TABLE_HEADER_ADD#}</th>
					</tr>
				<thead>
				<tbody>
					{foreach item="product" from=$split->getResults()}
						<tr>
							<td>
								{if $product->hasImage()}
									{html_image file=$product->getImageSrc() alt="*"}
								{else}
									{#TEXT_NO_IMAGE#}
								{/if}
							</td>
							<td>
								<div class="name">{$product->getName()}</div>
								<div class="description">{$product->getDescription()}</div>
								<div class="info">
									<a href="{$smarty.const.FILENAME_PRODUCT_INFO}?products_id={$product->getId()}">
										{#TEXT_MORE_INFORMATION#}
									</a>
								</div>
							</td>
							<td class="price">
								{$product->getPrice()}
							</td>
							<td class="buy">
								<form action="{$smarty.const.FILENAME_SHOPPING_CART}?action=add" method="post">
									<input type="hidden" name="products_id" value="{$product->getId()}" />
									<input type="submit" name="add_to_cart" value="{#TEXT_BUTTON_ADD_TO_CART#}" />
								</form>
							</td>
						</tr>
					{/foreach}
				</tbody>
			</table>
			
			{if $smarty.const.PREV_NEXT_BAR_LOCATION == 2 || PREV_NEXT_BAR_LOCATION == 3}
				{include file="paginate_results.tpl" split=$split}
			{/if}
		{else}
			<p>{#TEXT_NO_PRODUCTS#}</p>
		{/if}
		
{if !$embedded}
		{include file=$theme->getTemplateUrl("body_end.tpl")}
	</body>
</html>
{/if}
